﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using YJYpublicClass;

namespace HVisionCH
{
    public partial class Frm_Login : Form
    {
        public Frm_Login()
        {
            InitializeComponent();
        }


        private void Frm_Login_Load(object sender, EventArgs e)
        {
            this.Opacity = 0.8;

            com_UseName.SelectedIndex = 0;
            txt_PassWord.Focus();
            txt_PassWord.PasswordChar = '*';
            
        }

        private void check_DispPassword_CheckedChanged(object sender, EventArgs e)
        {
            if (check_DispPassword.Checked)
                txt_PassWord.PasswordChar = new char();
            else
                txt_PassWord.PasswordChar = '*';
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(com_UseName.Text=="技术员")
            {
                if(txt_PassWord.Text=="123456")
                {
                    PublicValue.LoginRight = 2;
                    this.Close();
                }else
                {
                    MessageBox.Show("密码错误");
                }

            }
            else if (com_UseName.Text == "管理员")
            {
                if (txt_PassWord.Text == "12345678")
                {
                    PublicValue.LoginRight = 3;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("密码错误");
                }

            }
        }

        private void lab_ChangePassword_Click(object sender, EventArgs e)
        {
          //  Frm_ChangePassword Frm_ChangePasswords = new Frm_ChangePassword();
            //Frm_ChangePasswords.ShowDialog();
        }
    }
}
